Page({
  data: {
    list: [],
  },

  onShow() {
    this.getList()
  },

  async getList() {
    const res = await wx.http.get('/repair', {
      current: 1,
      pageSize: 10,
    })
    // console.log(res)

    if (res.code !== 10000) return wx.utils.toast()

    this.setData({
      list: res.data.rows,
    })
  },

  goDetail(ev) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + ev.mark.id,
    })
  },

  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
